# @time     :2022/2/28
# @Author   :Simple
# @FileName :main
import os

import pytest

from util.config import REPORT_DIR, cases_path
from util.logger import log

if __name__ == "__main__":
    log.info("测试开始执行✈✈！")
    xml_report = os.path.join(REPORT_DIR, "xml")
    html_report = os.path.join(REPORT_DIR, "html")
    pytest.main(["--alluredir="+xml_report, cases_path])
    allure_report = f"allure generate {xml_report} -c -o {html_report}"
    log.info(allure_report)
    os.popen(allure_report)
    log.info("运行结束，生成测试报告♥❤！")

